home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- procedure Button1Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- uses
- AAPriQue, AAHshLnP, AACache;
-
- procedure TForm1.Button1Click(Sender: TObject);
- var
- Cache : TaaFileCache;
- SR : TSearchRec;
- Error : integer;
- FS : TFileStream;
- FullName : string;
- begin
- Cache := TaaFileCache.Create;
- try
- Cache.Folder := 'c:\temp';
- Cache.MaxDiskSize := 130 * 1024;
-
- Error := FindFirst ('.\aa*.pas', faAnyFile, SR);
- if (Error = 0) then begin
- while (Error = 0) do begin
- FullName := ExpandFileName(SR.Name);
- FS := TFileStream.Create(FullName, fmOpenRead+fmShareDenyWrite);
- try
- Cache.Add(FullName, Now, FS);
- finally
- FS.Free;
- end;
- Error := FindNext(SR);
- end;
- FindClose(SR);
- end;
-
- finally
- Cache.Free;
- end;
- end;
-
- end.
-